package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.SeatLockState;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 朱其鹏
 * @date 2024/3/27 15:23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("seat_locks")
public class SeatLockEntity implements Serializable  {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 锁座流水号
     */
    private String nbr;

    /**
     * 外部锁座流水号
     */
    private String extNbr;

    /**
     * 场次 id
     */
    private Long scheduleId;

    /**
     * 锁座状态
     */
    private SeatLockState state;

    /**
     * 解锁时间
     */
    private LocalDateTime unlockTime;

    /**
     * 锁座时长
     */
    private Integer duration;

    /**
     * 锁座数量
     */
    private Integer number;

    /**
     * 用户 id
     */
    private Long userId;

    private Long cinemaId;

    private Long tenantId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic(value = "null", delval = "now()")
    @TableField(select = false)
    private LocalDateTime deletedAt;

    @TableField(exist = false)
    private FilmScheduleEntity filmSchedule;

    @TableField(exist = false)
    private List<SeatLockMapEntity> seatLockMapList;
}